<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('添加养修信息预约')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-post-add">
			<input type="hidden" name="id" th:value="${appointment.id}">
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">客户名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" th:value="${appointment.customerName}" name="customerName" id="postName" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">联系方式：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" th:value="${appointment.customerPhone}" name="customerPhone"   required>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">预约时间：</label>
				<div class="col-sm-8">
					<div class="input-group date">
						<input name="appointmentTime" th:value="${#dates.format(appointment.appointmentTime, 'yyyy-MM-dd HH:mm')}"
							   class="form-control" placeholder="yyyy-MM-dd HH:mm" type="text">
						<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">车牌号码：</label>
				<div class="col-sm-8">
					<input class="form-control" th:value="${appointment.licensePlate}" type="text" name="licensePlate"  required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">汽车类型：</label>
				<div class="col-sm-8">
					<input class="form-control" th:value="${appointment.carSeries}" type="text" name="carSeries" required>
				</div>
			</div>

 			<div class="form-group">
				<label class="col-sm-3 control-label is-required">服务类型：</label>
				<div class="col-sm-8">
					<select class="form-control"  name="serviceType" th:with="type=${@dict.getType('cmi_service_type')}">
						<option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}" th:field="${appointment.serviceType}">所有</option>
					</select>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">备注信息：</label>
				<div class="col-sm-8">
					<textarea id="remark" name="info" class="form-control valid">[[${appointment.info}]]</textarea>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<th:block th:include="common/include :: datetimepicker" />
	<script type="text/javascript">
		var prefix = ctx + "/business/appointment";
		
		function submitHandler() {
	        if ($.validate.form()) {
				// 保存信息 刷新表格
	        	// 若依的save方法，参数1：提交的地址 参数2：提交带的数据 参数3：回调函数（这里没有传）
	        	$.operate.save(prefix + "/edit", $('#form-post-add').serialize());
	        }
	    }

	    //====配置时间插件======
		$("input[name='appointmentTime']").datetimepicker({
			format: "yyyy-mm-dd hh:ii",
			autoclose: true
		});
	</script>
</body>
</html>
